<?php

function addShift($authUser, $authUserPass, $arrayOfData)
{
	if (checkAuthorization($authUser, $authUserPass) != true){
		return array(ErrorCode::authFailRead);
	}

	$conn=mysql_connect("127.0.0.1","root","","paradigmShift_DEV");
	if(!$conn)
	{
		die('Could not connect: ' . mysql_error());
		return array(ErrorCode::sysError);
	}

	$sql = "INSERT INTO RoleDate (roleID, empID, dateID, startTime, endTime, shiftStatus) VALUES (".
			$arrayOfData['roleID'] .",".
			$arrayOfData['empID'] .",".
			$arrayOfData['dateID'] .",".
			$arrayOfData['startTime'] .",".
			$arrayOfData['endTime'] .",".
			$arrayOfData['shiftStatus'] .
			");";
	if (mysql_query($conn, $sql)){
		mysql_close($conn);
		return array(ErrorCode::successUpdate);
	} else {
		mysql_close($conn);
		return array(ErrorCode::failDelete);
	}
}

?>